package com.gift.controller;

import com.gift.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@EnableAutoConfiguration
@RequestMapping("login")
public class LoginController {

    public final static Logger logger = LoggerFactory.getLogger(LoginController.class);

    @Autowired
    private UserService userService;

    @RequestMapping("/")
    public String index() {
        return "ddd";
    }

    @RequestMapping("/getRandomCodeImg")
    public void getRandomCodeImg(HttpServletRequest request, HttpServletResponse response) {
        try {
            userService.getRandomCodeImg(request,response);
        }catch (Exception e){
            logger.error("--[LoginController]getRandomCodeImg--获取图片验证码异常: ");
            e.printStackTrace();

        }
    }


}